/*-----------------------------------------------------------*/
/*copyright by 动力无限  www.btoe.cn*/
/*邮箱 btoe@btoe.cn*/
/*合作电话 400-0599-360*/
/*版权所有违者必究*/
/*-----------------------------------------------------------*/

$('.cover .hd li').click(function () {
    //按钮
    var index = $(this).index();
    $('.cover .hd li').removeClass('on');
    $(this).addClass('on');
    //on 为需要替换的新样式
    $('.cover .bd li').eq(index).show('normal').siblings('.cover .bd li').hide('normal');
    //选项卡大盒子
})


$('.coverAlert').show()

$('.cover .hd li').eq(0).trigger('click');
var cover = $(".cover");
$(function () {
    $(".share").click(function (event) {
        showDiv();//调用显示DIV方法
        $(this).hide(300);
        $(document).one("click", function () {//对document绑定一个影藏Div方法
            $(cover).hide();
        });
        event.stopPropagation();//阻止事件向上冒泡
    });
    $(cover).click(function (event) {
        event.stopPropagation();//阻止事件向上冒泡
    });
});
function showDiv() {
    $(cover).fadeIn();
}
$('share').trigger("click");
$(function () {
    $(".abth").click(function (event) {
        $(".cover").hide(500);
        var e = window.event || event;
        if (e.stopPropagation) {
            e.stopPropagation();
        } else {
            e.cancelBubble = true;
        }
        $(".coverAlert").show(500);
        $(".coverAlert").css({
            'left': '5%',
            'opacity':'1',
       
        });

    });
    $(".coverAlert").click(function (event) {
        var e = window.event || event;
        if (e.stopPropagation) {
            e.stopPropagation();
        } else {
            e.cancelBubble = true;
        }
    });
    document.onclick = function () {
        $(".coverAlert").hide(500);
        $(".share").show(500);
    };
})




// $(function () {
//     var winHeight = $(window).height();
//     var coverAleartHeight = $('.coverAlert img').height();
//     var coverAleartTop = (winHeight - coverAleartHeight) / 2;
//     console.log('可视化高度' + $(window).height());
//     console.log('图片高度' + coverAleartHeight);
//     console.log('相减之后剩余高度' + (winHeight - coverAleartHeight));
//     $('.coverAlert').css('top', coverAleartTop + 'px');

// })








